<?php
session_start();
$qty = $_POST["qty"];

foreach ($qty AS $k => $v) {
    $i = 0;
    foreach ($_SESSION['cart'] AS $x => $y) {
        if ($i < $k) {
            $i++;
            continue;
        }

        $_SESSION['cart'][$x]['qty'] = $v;
        break;
    }
}
header('Location: cart.php');
?>